// JavaScript Document

function revisado(id, user, name){	
	var check="rev"+id;
	var chk;
	if (document.getElementById(""+check+"").checked==true){ chk=1; }else{ chk=0; }
	var nobs="obs"+id;	
	var obs = document.getElementById(""+nobs+"").value;
	
	var dir="registro_revisado.php?id_registro="+id+"&user="+user+"&val="+chk+"&obs="+obs;
	var div="div"+id;
	new Ajax.Updater(""+div+"", dir,{evalScripts:true});	
}

function cumplido(id_cump, user){	
	var check_rev="rev"+id_cump;	
	var check="cump"+id_cump;
	var chk;
	
	if (document.getElementById(""+check+"").checked==true && document.getElementById(""+check_rev+"").checked==false){
		alert('DEBE MARCAR LA OPCION DE REVISADO');
		document.getElementById(""+check_rev+"").focus();
		document.getElementById(""+check+"").checked=false; 
		return false;
	}
	if (document.getElementById(""+check+"").checked==true){ chk=1; }else{ chk=0; }
	/*var nobs="obs"+id;	
	var obs = document.getElementById(""+nobs+"").value;*/
	
	var dir="registro_revisado.php?id_cump="+id_cump+"&user="+user+"&val="+chk;
	var div="div_"+id_cump;
	new Ajax.Updater(""+div+"", dir,{evalScripts:true});	
}

function registros(){
		
		document.getElementById("reporte").innerHTML = "<center><img src='images/aero_busy_xl.gif' border='0'></img>&nbsp;<strong>Cargando...</strong></center>";
	
	
	if(document.getElementById('cump').checked==true){
		scump=0;
	} else {
		scump=1;
	}

	var dir="rpt_pacientes_revisado.php?scump="+scump;	
	new Ajax.Updater("reporte", dir,{evalScripts:true});	
}
